<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function cal(){
				var num1=document.getElementById("num1").value;
				var num2=document.getElementById("num2").value;
				var num3=eval(`${num1}${event.target.innerHTML}${num2}`);
				document.getElementById("num3").value=num3;
			}
		</script>
	</head>
	<body>
		第一个数：<input type="text" id="num1" />
		<br>
		第二个数：<input type="text" id="num2" />
		<br>
		<button onclick="cal()">+</button>
		<button onclick="cal()">-</button>
		<button onclick="cal()">*</button>
		<button onclick="cal()">/</button>
		<br>
		计算结果：<input type="text" id="num3" disabled="disabled"/>
	</body>
</html>
